import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2025-03-11
 * Time: 22:33
 */
public class test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long k = scanner.nextLong();
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        //数组从大到小进行排序——冒泡排序
        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < n - i - 1; j++) {
                if (arr[j] < arr[j + 1]) {
                    long temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        int i=0;
        for(int j=0;j<k&&i<n;i++){
                while (arr[i]>=arr[i+1]&&arr[i]%2==0){
                    arr[i]/=2;
                    j++;
            }
        }
        int sum=0;
        for (int j = 0; j < n; j++) {
            sum+=arr[j];
        }
        System.out.println(sum);

    }
}
